<?php
/*
* @desc 自由行控制类
* @author kevin.wang
* @date 2015-01-01 12:00:00
*/
class TripController extends Controller
{
	//自由行列表页面
	public function actionIndex()
	{
		$this->render('index');
	}
	//商品详情页面
	public function actionDetail()
	{
		$request = Yii::app()->request;
		$goods = new Goods();
		$produce = $goods->getGoodsDetail($request->getParam('goodssn'));
		if(empty($produce)){
			throw new ExceptionClass("商品未找到");
		}
		$model = new DailyTrip;
		$dailyTrip = $model->getDailyTrip($produce["goods_id"]);
		if(empty($dailyTrip)){
			throw new ExceptionClass("日程获取失败");
		}
		$this->render('detail', array(
			'produce' => $produce,
			'dailyTrip' => $dailyTrip
			));
	}
}
